<!-- The documentation for the l-system input view. -->

<HTML><HEAD>
<TITLE>The L-System Editor</TITLE>
</HEAD><BODY>

<H1>The L-System Editor</H1>

<P ALIGN="center"><IMG SRC="images/lsys-input.png" ALT="L-system Input Pane" WIDTH="414" HEIGHT="254" ALIGN="middle" BORDER=1></P>

<P>As always, this documention assumes some general familiarity with L-systems and only describes JFLAP's implementation of these structures.  JFLAP allows a user to define an L-system and to render that system with an arbitrary level of substitution in three dimensions.  The formal definition of an L-system requires three components, to which we add one to aid in drawing:</P>

<DL>
<DT><B>System alphabet</B></DT>
<DD>JFLAP does not require the user to explicityly set the alphabet (i.e. set of recognized symbols) of the system.  If a symbol is does not have significance to whatever is attempting to interpret it is ignored, e.g. a renderer of an L-system would be interested in those symbols that affect the rendering and those symbols which have replacement rules.<P>

While the rules of replacement, the presence of an axiom, and soforth are universal to L-systems, the interpretation of those symbols to render a graphic is not part of the mathematical definition.  At present there is one L-system renderer in JFLAP, and its description, including the symbols it recognizes, may be found <A HREF="gui.lsystem.DisplayPane.html">here</A>.<P></DD>

<DT><B>Axiom</B></DT>
<DD>At the top of the editing view is a text field for typing in the axiom labeled, appropriately enough, "axiom."  As mentioned before symbols are space delimited.  In the example given above, the three symbols in the axiom are <VAR>+</VAR>, <VAR>g</VAR>, and <VAR>L</VAR>, in that order.<P></DD>

<DT><B>Rewriting Rules</B></DT>
<DD>Below the axiom is a series of productions that represent the replacement rules; one enters these just as one would <A HREF="gui.grammar.GrammarInputPane.html">enter productions for a grammar</A>.  As with the axiom, symbols must be space delimited.  In most cases you will want only one symbol on the left.  The two rewriting rules in the example picture are <VAR>L <IMG SRC="entities/rarr.png" WIDTH="16" HEIGHT="7" ALIGN="absmiddle"> L + R g +</VAR> and <VAR>R <IMG SRC="entities/rarr.png" WIDTH="16" HEIGHT="7" ALIGN="absmiddle"> - g L - R</VAR>, that is, going from one level of substitution to the subsequent level of substitution, every <VAR>L</VAR> shall be replaced with the five symbols <VAR>L + R g +</VAR>, and every <VAR>R</VAR> shall be replaced with the five symbols <VAR>- g L - R</VAR>.<P>

You can also have multiple symbols on the left side of the rewriting rule.  JFLAP offers rules that are sensitive to context.  These rules take the form of <VAR>i a<SUB>0</SUB> a<SUB>1</SUB> ... a<SUB>i-1</SUB> a<SUB>i</SUB> a<SUB>i+1</SUB> ... a<SUB>n-2</SUB> a<SUB>n-1</SUB></VAR>.  In this list of <VAR>n+1</VAR> symbols, the <VAR>i</VAR> symbol is an integer from <VAR>0</VAR> inclusive to <VAR>n</VAR> exclusive; the symbol <VAR>a<SUB>i</SUB></VAR> is the symbol potentially being rewritten, but only if the string of symbols <VAR>a<SUB>0</SUB> a<SUB>1</SUB> ... a<SUB>i-1</SUB></VAR> come before it and <VAR>a<SUB>i+1</SUB> ... a<SUB>n-2</SUB> a<SUB>n-1</SUB></VAR> come after it.  For example, the rewriting rule <VAR>2 a b c d <IMG SRC="entities/rarr.png" WIDTH="16" HEIGHT="7" ALIGN="absmiddle"> x y z</VAR>, in an expansion <VAR>c</VAR> would be rewritten with <VAR>x y z</VAR> if preceeded by the two symbols <VAR>a b</VAR> and the symbol <VAR>d</VAR>.<P>

If multiple replacement rules dictate that a symbol is to be rewritten, one of the rules will be chosen uniformly at random when the expansion of symbols occurs.  Additionally, lambda productions are allowed and indicate simply that the symbol should be removed.<P></DD>

<DT><B>Drawing Parameters</B></DT>
<DD>Below the grammar input, and at the bottom of the window, there is a table the user may set parameters that affect the rendering of the L-system.  The user enters the parameter name in the left column, and its value in the right column.  In the example L-system input figure, we have the two parameters named <VAR>angleIncrement</VAR> and <VAR>distance</VAR>, with values <VAR>90</VAR> and <VAR>4</VAR> respectively.  Mind you, these parameter names are case sensitive!  If the same parameter is defined multiple times in the table, only the last definition of the parameter is respected.<P>

Above the right scroll bar, just to the right of the "Parameter" column label, there is a small button.  If you press it, you will see a popup menu with a list of those parameters the L-system renderer in JFLAP recognizes (one can't remember them all, can we?).  For a full description of these parameters, view the pages for the L-system Renderer  When you select a parameter name from this list, it will be entered into the table, and you will begin editing the value for that parameter.  If you select a parameter that already exists in the table, then you will begin editing the parameter value for the existing entry.<P></DD>
</DL>

<H2>In Haiku</H2>

<P>The axiom field<BR>
holds the starting point<BR>
of the L-system.</P>

<P>The middle table<BR>
displays the rewriting rules.<BR>
You edit them here!</P>

<P>Rewriting rules look<BR>
like a grammar production<BR>
with left and right sides.</P>

<P>A rule's left side holds<BR>
the symbol to replace in<BR>
derivation strings.</P>

<P>The right side contains<BR>
what symbols the left symbol<BR>
will be replaced with.</P>

<P>The strings of symbols<BR>
in JFLAP's L-systems are<BR>
space delimited.</P>

<P>Strings without whitespace<BR>
should therefore be considered<BR>
a single symbol.</P>

<P>That is important!<BR>
Don't mistake "gfgg"<BR>
for "g f g g"!</P>

<P>The bottom table<BR>
holds drawing parameters<BR>
for the L-system.</P>

<P>Parameters set<BR>
in this table change how the<BR>
L-system renders.</P>

<P>The left column "Name"<BR>
holds the parameter name.<BR>
Right holds the value.</P>

<P>As an example,<BR>
set "color" to the value "green"<BR>
and "g" draws green lines!</P>

<P>Also, consider<BR>
setting "distance" to "18".<BR>
Lines are that length now.</P>

<P>You click in the box<BR>
above the table's scroll bar<BR>
for a list of names.</P>

<P>Choose one of these names,<BR>
and that named parameter<BR>
shows in the table.</P>

<P>Want to render this?<BR>
You choose the menu item<BR>
named "Render System"</P>

</BODY></HTML>
